﻿
function checkData(data) {
    if (JSON.stringify(data).indexOf("ErrorMessage") > 0)
    {
        re = /ErrorMessage":"([^"]+)/ig;
        var arr = JSON.stringify(data).match(re);
        var resStr = "";
        for (var i = 0; i < arr.length; i++) {
            resStr += " " + arr[i].substr(15) + "\r\n";
        }
        alert(resStr);
        return false;
    }
    return true;
}


String.prototype.StringFormat = function () {
    if (arguments.length == 0) {
        return this;
    }
    for (var StringFormat_s = this, StringFormat_i = 0; StringFormat_i < arguments.length; StringFormat_i++) {
        StringFormat_s = StringFormat_s.replace(new RegExp("\\{" + StringFormat_i + "\\}", "g"), arguments[StringFormat_i]);
    }
    return StringFormat_s;
};
//用法 ： var str = "{0}{1}".StringFormat("Eric", "Yu");
// str = "EricYu"







$(document).ready(function () {

    $("#Comment_Cancel").click(function () {
        $("#comment_form_dialog").hide();
    });

});


function GetQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]); return null;
}